﻿  //początek skryptu z listingu 6.9
  function zmieniaj()
  {
    if(!el){
      clearInterval(timerId);
      return;
    }
    for(var i = 0; i < długośćTekstu; i++){
      document.getElementById("l" + i ).style.color = 
        tabKolorów[(poz + i) % tabKolorów.length];
    }
    if(kierunek == 'lewo'){
      if(++poz >= tabKolorów.length) poz = 0;
    }
    else{
      if(--poz < 0) poz = tabKolorów.length;
    }
  }
</script>